#ifndef PAGETRAINNUMSET_H
#define PAGETRAINNUMSET_H

#include <QWidget>
#include <QLineEdit>
#include <QKeyEvent>
#include <QEvent>
#include <QTimer>
#include "global_def.h"
#include "slimnumkeyboard.h"

namespace Ui {
class PageTrainNumSet;
}

class PageTrainNumSet : public QWidget
{
    Q_OBJECT

public:
    explicit PageTrainNumSet(QWidget *parent = nullptr);
    ~PageTrainNumSet();
    void setPageActive(bool xActive);
    uint8_t getLineIDInput();
    uint8_t getTrainIDInput();
    void setLineID(uint8_t id);
    void setTrainID(uint8_t id);
private slots:
    void on_Btn_Return_clicked();
protected:
     bool eventFilter(QObject *obj, QEvent *event);
signals:
    void returnToMaintMenu();
    void signal_LineSetValid(bool);
    void signal_TrainIDSetValid(bool);
private slots:
    void input_slot(int);
    void backspace_slot();
    void cancel_slot();
    void on_Btn_LineNoSet_clicked();
    void on_Btn_TrainNoSet_clicked();

private:
    SlimNumKeyBoard *m_pKeyBoard= nullptr;
    QList<QLineEdit*> inputlist;
    QLineEdit *m_pFocusLinedit= nullptr;
private:
    Ui::PageTrainNumSet *ui;
};

#endif // PAGETRAINNUMSET_H
